package nl.Viewer.SerializedObjects;

/**
 * A wrapper object for a tuple of parameterName/value
 * 
 * @author Administrator
 *
 */

public class ParameterValue {
   public final String parameterName;
   public final Object value;
   
   public ParameterValue(String parameterName, Object value) {
      this.parameterName = parameterName;
      this.value = value;
   }
   
   public String toString() {
      String valueRepresentation;
      if(value instanceof Object[]) {
         valueRepresentation = "";
         for(Object o : ((Object[])value)) {
            if(valueRepresentation.length() > 0) valueRepresentation += ", ";
            valueRepresentation += o.toString();
         }
      } else {
         valueRepresentation = value.toString();
      }
      
      return "ParameterValue ["+parameterName+"] = "+valueRepresentation;
   }
   
}
